package com.zlt.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000117644395";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDDoR26uHjLecGHT6UStR1ZWJtfVmmV5y78e+x1WeWjGxqvR++/EQ3VRd3tCLloNMtezwPHS00KqoXnmyCX8zcio/K/5+xOzGJdCoA+ByPRC5mvY3bMAcS9N4JnWAkeINpFbDyMNZ2+kqFGJlobGscyxQIpkQTBDW9aGlPhGSSOWNEaVZ9CQz3OjKFHX7MJyQEVc4PBES58+1fknmk0+JAkSB5FhVKwRzU07N0q+w+NWSEUrwSskoNR8yTwAfcFLypEjXwOOrBO+DYpTx7E61BUaJoj5NrsySu8yP/SMCohyjSJ8rzySoTcwf6yIQmjrhOQDlhWG9Cmb75xwP6Xla03AgMBAAECggEAYGwTKSsvbqsOdlENPdFDK/x+aFlBJX+TKyMxgw3SH7iGSIqeYoBXXx1WqzQ3nmMXMh268QnuaSlvYp6VTA+2xz4jse7wDE601MMOPoRqZOjg0Q+nSBo/DDxF7AX6SH1M2BbnKPxsSbggAWF53A4wzJdJ34741uZ2UeTUHwizeez0UdacqrOAdDzPpSkJPxpIbc0X+9/zDJuY12+D/roK7Ug8PgB1L4jFcHFBntAKPmuQLmqhzhlmelINnsAnG9vIJAEFnBy2XAIGK30QTeogf+RfL5jDvdwNQI8o8zzYrANRnHSheG11u7g4JIzXD6lutl5u3ZtD6qLEahywMviFgQKBgQDjRBbXwVism0HT/t9VqUIGPC5dzrP6sFgSe5EGWA6lVxtIf5/FCtxsZhuFFK/BWUjsne7amCSG+T3m3oia8BFTXIESYMLu4nGdsoc7icmeYp1DuTfjs/YPBhw2eujlUM+2tpF/Q67h88+fUbxJoJv7UwqyP3yILie8+Dd/juW9FwKBgQDcXQusb7+678Jo91eH5xG888KK4+zEnsL14XL96OV3SfzoPKR2TG7p5NgktyGIAZTOAci0u8C8dKn1GjmsgeQQkmpUXZxh0wsOWOy5wjCHHdXu1aJ2Tj19xtLAinH0Zn7Yba6DJWIxdY5fl6Pqwa8O74tRir3EZ64zbaP61A7k4QKBgQCogwo0/IYVpiFPYcKTr6bnHKR8phHJpgwH2FuWSqDBdC8kuIzs+7qpHaT2LnqLcPqjiA9dQkaDVjfSAdtklvEh0Itb5ydjHcCE36VqPiajLBfT6XhJfFzMkwlEVCpwLlV18zU7GiKII9IlHePw7Af8eHyL4osiJqcMdTghewFaDQKBgQCkdNRXdnayfmiqiZ1LkYlNaOYRXZTAEHQTqJN3Jy7JXfBfKZLbrqM/70fX7swZgoSZUf+F0nE+tBp7D31nXvDj5UFxgQNKhoRDyt2wrFonHH8iZVF/1VhS2+VBSJFPAoc74m9Q9L9ZhhAhCzyL4MxS6zcgPdjuESqSuwqcEVKkQQKBgHnhkwB5WlrhYzMDnZbTCKcHRMJhIV4Pwlfy6T4vj+yONi9L20EQse8c8KuIuOmUWMGdcyUWwwX4cyTiXadLTWADqLk37P6sjq7diJofEvKWV9M+ktTn04JxmGRpno4jZyxhmvg+mvM2/pXip6dQOiUy7Q5zrEhdNVRjxV3bhEyq";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAovzYYy2ISGSD3lJ5ZxWbkEXPnrggmX441n7TB1JbEkV7vEVU531RLzf07ExkBRwhzr1d2wHhK70K51c5/vLCOaPdhS04Yev7QY2Szm179Y3dGmwA5B2nzvFjKKNpQEswScXsp+vDKuhJVrD68Zzi+PY710R/R71daUJA9vDLCRXRmfMIiOi7QCi4YIcH0P+nEomuGlb+1Tzy/xMSYLcw84VgFYipLcMikrb+bMmowJnjI2bZGHnCKCG/vvS5FtT4FMGRO/ZfZvvifFAlsfGU3OXNGDo+bf293NXFWaSqVi4M89I7kiEy4i3jkDIvcGHDo9tiAD/8fRcOBCax9k9CxwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://127.0.0.1/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://ama58s.natappfree.cc/order/reurl.html";//内网穿透地址

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

